<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>约健</title>
<link href="/new18yuejian/Public/yuejian/css/bootstrap.min.css" rel="stylesheet">
<link href="/new18yuejian/Public/yuejian/css/datepicker3.css" rel="stylesheet">
<link href="/new18yuejian/Public/yuejian/css/bootstrap-table.css" rel="stylesheet">
<link href="/new18yuejian/Public/yuejian/css/styles.css" rel="stylesheet">
<script type="text/javascript" src="/new18yuejian/Public/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="/new18yuejian/Public/pagestyle.css">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>

	<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation" style="background-color: #18BB9C">
		<div class="container-fluid">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sidebar-collapse">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#"><span style="color: #FFFFFF">约健</span>体育联盟俱乐部管理平台</a>
				<ul class="user-menu">
					<li class="dropdown pull-right">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span><?php echo ($_SESSION['aname']); ?><span class="caret"></span></a>
						<ul class="dropdown-menu" role="menu">
							<li><a href="#"><span class="glyphicon glyphicon-user"></span> 个人中心</a></li>
							<li><a href="#"><span class="glyphicon glyphicon-cog"></span> 设置</a></li>
							<li><a href="#"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
						</ul>
					</li>
				</ul>
			</div>
							
		</div><!-- /.container-fluid -->
	</nav>
		<div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar" style="box-shadow: 2px;border-radius: 8px;background-color: #222D31">
		<!-- <form role="search"> -->
			<div class="form-group" style="height: 12px">
				<!-- <input type="text" class="form-control" placeholder="Search"> -->
			</div>
	<!-- 	</form> -->
		<ul class="nav menu"  style="box-shadow: 2px;border-radius: 8px;">
			<li class="parent ">
				<a href="#">
					<span class="glyphicon glyphicon-list"></span><span >视频管理</span><span data-toggle="collapse" href="#sub-item-1" class="icon pull-right"><em class="glyphicon glyphicon-s glyphicon-plus"></em></span> 
				</a>
				<ul class="children collapse" id="sub-item-1">
					<li>
						<a class="" href="<?php echo U('Video/videolist');?>">
							<span class="glyphicon glyphicon-share-alt"></span> 视频列表
						</a>
					</li>
					<li>
						<a class="" href="<?php echo U('Video/addvideo');?>">
							<span class="glyphicon glyphicon-share-alt"></span> 上传新视频
						</a>
					</li>
					<li>
						<!-- <a class="" href="#">
							<span class="glyphicon glyphicon-share-alt"></span> Sub Item 3
						</a> -->
					</li>
				</ul>
			</li>
			<li class="parent ">
				<a href="#">
					<span class="glyphicon glyphicon-list"></span><span >大师管理</span><span data-toggle="collapse" href="#sub-item-2" class="icon pull-right"><em class="glyphicon glyphicon-s glyphicon-plus"></em></span> 
				</a>
				<ul class="children collapse" id="sub-item-2">
					<li>
						<a class="" href="<?php echo U('Mm/mmlist');?>">
							<span class="glyphicon glyphicon-share-alt"></span>大师列表
						</a>
					</li>
					<li>
						<a class="" href="<?php echo U('Mm/addmm');?>">
							<span class="glyphicon glyphicon-share-alt"></span> 初始化大师账号
						</a>
					</li>
					<li>
						<!-- <a class="" href="#">
							<span class="glyphicon glyphicon-share-alt"></span> Sub Item 3
						</a> -->
					</li>
				</ul>
			</li>

			<li class="parent ">
				<a href="#">
					<span class="glyphicon glyphicon-list"></span> 活动管理<span data-toggle="collapse" href="#sub-item-3" class="icon pull-right"><em class="glyphicon glyphicon-s glyphicon-plus"></em></span> 
				</a>
				<ul class="children collapse" id="sub-item-3">
					<li>
						<a class="" href="<?php echo U('Act/actlist');?>">
							<span class="glyphicon glyphicon-share-alt"></span> 活动列表
						</a>
					</li>
					<li>
						<a class="" href="<?php echo U('Act/addact');?>">
							<span class="glyphicon glyphicon-share-alt"></span> 更新活动
						</a>
					</li>
					<li>
						<!-- <a class="" href="#">
							<span class="glyphicon glyphicon-share-alt"></span> Sub Item 3
						</a> -->
					</li>
				</ul>
			</li>
			<li class="parent ">
				<a href="#">
					<span class="glyphicon glyphicon-list"></span> 培训管理 <span data-toggle="collapse" href="#sub-item-4" class="icon pull-right"><em class="glyphicon glyphicon-s glyphicon-plus"></em></span> 
				</a>
				<ul class="children collapse" id="sub-item-4">
					<li>
						<a class="" href="<?php echo U('Training/addtraining');?>">
							<span class="glyphicon glyphicon-share-alt"></span> 添加培训
						</a>
					</li>
					<li>
						<a class="" href="<?php echo U('Training/tralist');?>">
							<span class="glyphicon glyphicon-share-alt"></span> 培训列表
						</a>
					</li>
				</ul>
			</li>
			<li class="parent ">
				<a href="#">
					<span class="glyphicon glyphicon-list"></span> 赛事管理 <span data-toggle="collapse" href="#sub-item-5" class="icon pull-right"><em class="glyphicon glyphicon-s glyphicon-plus"></em></span> 
				</a>
				<ul class="children collapse" id="sub-item-5">
					<li>
						<a class="" href="<?php echo U('Game/gamelist');?>">
							<span class="glyphicon glyphicon-share-alt"></span>比赛列表
						</a>
					</li>
					<li>
						<a class="" href="<?php echo U('Game/addgame');?>">
							<span class="glyphicon glyphicon-share-alt"></span> 更新比赛
						</a>
					</li>
				</ul>
			</li>
			
			<li role="presentation" class="divider"></li>
			<!-- <li><a href="#"><span class="glyphicon glyphicon-user"></span> Login Page</a></li> -->
		</ul>
		
	</div><!--/.sidebar-->

	<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">			
		<div class="row">
			<ol class="breadcrumb">
				<li><a href="#"><span class="glyphicon glyphicon-home"></span></a></li>
				<li class="active">视频管理</li>
			</ol>
		</div><!--/.row-->
		
		<div class="row">
            <div class="col-lg-12">
                <div class="page-header" style="padding-bottom: 0px"></div>
            </div>
        </div><!--/.row-->
		
		<div class="row">
			<div class="col-lg-12">
				<div class="panel panel-default">
					<div class="panel-heading">上传新视频</div>
					<div class="panel-body">
					<!-- <div id="pro" style="width: 600px;height: 20px;border:1px solid green;margin: 0 auto">
						<div id="bar" style="width: 0%;height: 100%;background-color: green">
							
						</div>
					</div> -->
					<div class="col-md-3"></div>
						<div class="col-md-6">
						
							
							
								<div class="form-group">
									<label>选择视频</label>
									<input type="file" name="filevideo">
									<!-- <textarea class="form-control" rows="6"></textarea> -->
								</div>
					         	<div class="form-group">

	    <button type="submit" class="btn btn-primary" onclick="savevideofile()">点击上传</button>
								<button type="reset" class="btn btn-default">重置</button>
								<div id='msg'></div>
								</div>
							</div>
							
 <script type="text/javascript">
 // function savevideofile(){
 // 		var vd = document.getElementsByTagName('input')[0].files[0];
 // 		var fd = null;
 // 			fd = new FormData();
 // 			fd.append('filevideo',vd);
 // 		var xhr = new XMLHttpRequest();
 // 			xhr.open('POST',"<?php echo U('Video/uploadvdfile');?>",false);
 // 			xhr.onreadystatechange = function(){
 //               document.getElementById('msg').innerHTML = this.responseText;
 // 			}
 // 			xhr.upload.onprogress = function(ev){
 //                      alert("00000");
 // 			}
 // 		// 	// xhr.upload.onprogress = function(ev){
 // 		// 	// 	console.log(ev);
 // 		// 	// 	// if(ev.lengthComputable){
 // 		// 	// 	// 	var res = ev.loaded/ev.total * 100;
 // 		// 	// 	// 	document.getElementById('bar').style.width = res + "%";
 // 		// 	// 	// }
 // 		// 	// }
 // 			xhr.send(fd);

 // 	}
 	function savevideofile(){
 		var vd = document.getElementsByTagName('input')[0].files[0];
 		//console.log(vd);
 		const sentlength = 2 * 1024 * 1024;
 		var sta = 0;
 		var end = sta + sentlength;
 		var blob = null;
 		var fd = null;
 		var xhr = null;
 		var sumsize = vd.size;
 		while (sta<sumsize) {
 			blob = vd.slice(sta, end);
 			fd = new FormData();
 			fd.append('filevideo',blob);
 		    xhr = new XMLHttpRequest();
 			xhr.open('POST',"<?php echo U('Video/uploadvdfile');?>",false);
 			xhr.upload.onprogress = function(){
 				alert("00000");
 			}
 			// xhr.onreadystatechange = function(){
    //            document.getElementById('msg').innerHTML = this.responseText;
 			// }
 			xhr.send(fd);
 			sta = end;
 			end = sta + sentlength;
 		}

 	}
 </script>

						
					</div>
				</div>
			</div><!-- /.col-->
		</div><!-- /.row -->
		
	</div><!--/.main-->

   	<script src="/new18yuejian/Public/yuejian/js/jquery-1.11.1.min.js"></script>
    <script src="/new18yuejian/Public/yuejian/js/bootstrap.min.js"></script>

<!-- 	<script src="/new18yuejian/Public/yuejian/js/chart.min.js"></script> -->
<!-- 	<script src="/new18yuejian/Public/yuejian/js/chart-data.js"></script> -->
<!-- 	<script src="/new18yuejian/Public/yuejian/js/easypiechart.js"></script> -->
<!-- 	<script src="/new18yuejian/Public/yuejian/js/easypiechart-data.js"></script> -->
	<script src="/new18yuejian/Public/yuejian/js/bootstrap-datepicker.js"></script>
	<!-- <script src="/new18yuejian/Public/yuejian/js/bootstrap-table.js"></script> -->
	<script>
		!function ($) {
			$(document).on("click","ul.nav li.parent > a > span.icon", function(){		  
				$(this).find('em:first').toggleClass("glyphicon-minus");	  
			}); 
			$(".sidebar span.icon").find('em:first').addClass("glyphicon-plus");
		}(window.jQuery);

		$(window).on('resize', function () {
		  if ($(window).width() > 768) $('#sidebar-collapse').collapse('show')
		})
		$(window).on('resize', function () {
		  if ($(window).width() <= 767) $('#sidebar-collapse').collapse('hide')
		})
	</script>	
</body>

</html>